#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("matrix.in" , "r" , stdin);
	freopen("matrix.out" , "w" , stdout);
	int n , x , y , ans = 0;
	cin >> n >> x >> y;
	int c = min(x , min(y , min(n + 1 - x , n + 1 - y)));
	int st = 1;
	for(int i = 1 ; i < c ; i++){
		st += (n - i * 2 + 1) * 4;
	}
	int ed = st + (n - c * 2 + 1) * 4;
	if(x <= y){
		ans = st + x - c + y - c;
	}
	else{
		ans = ed - (x - c + y - c);
	}
	cout << ans << endl;
	return 0;
}
